<template>
  <div class="wallet">
    <Theme :theme="theme"></Theme>
    <div class="content">
      <ul>
        <li v-for="(v, i) in mon" :key="i">
          <div>￥{{ v.parice }} <span>全国通用劵</span></div>
          <van-stepper
            :value="value"
            async-change
            @change="onChange"
            disable-input
          />
        </li>
      </ul>
    </div>
    <div class="content_bottom">
      <div class="he">
        理应合付 <span>￥{{ this.value * mon[0].parice }}</span>
      </div>
      <div class="money" ref="money">去支付</div>
    </div>
  </div>
</template>

<script>
import Theme from "../../components/lsc/theme.vue";
import { Toast } from "vant";
export default {
  components: { Theme },
  methods: {
    onChange(value) {
      Toast.loading({ forbidClick: true });
      if (value > 1) {
        this.$refs.money.style = "opacity:1";
      } else {
        this.$refs.money.style = "opacity:.7";
      }
      clearTimeout(this.timer);
      this.timer = setTimeout(() => {
        Toast.clear();
        // 注意此时修改 value 后会再次触发 change 事件
        this.value = value;
      }, 100);
    },
  },

  data() {
    return {
      theme: "充值咖啡钱包",
      value: 1,
      mon: [{ parice: 100 }],
    };
  },
  created() {},
};
</script>

<style scoped>
.wallet {
  width: 100%;
  min-height: 6.4rem;
  background-color: #efeff4;
}
/deep/.van-nav-bar {
  background-color: #f5f5f5;
}
/deep/.van-nav-bar .van-icon {
  color: gray;
}
.content {
  padding-top: 0.46rem;
}
.content ul {
  width: 90%;
  margin: 0 auto;
  height: 100%;
}
.content ul li {
  padding: 0.1rem;
  display: flex;
  justify-content: space-around;
  background-color: #fff;
  border: 0.01rem solid #ccc;
  margin: 0.1rem 0;
}
.content ul li div span {
  display: inline-block;
  margin-left: 0.2rem;
}
.content ul li .vl {
  float: right;
}
.content_bottom {
  width: 100%;
  height: 0.7rem;
  line-height: 0.7rem;
  background-color: #f5f5f5;
  position: fixed;
  bottom: 0;
  display: flex;
  justify-content: space-between;
}
.content_bottom .he {
  text-indent: 1em;
}
.content_bottom span {
  font-size: 22px;
}
.money {
  width: 1rem;
  height: 0.7rem;
  text-align: center;
  color: #fff;
  background-color: #2d5387;
  opacity: 0.7;
}
</style>